# Feeling Dicey
Because that's why I wrote this program.

## Build and Install
The following line builds the program and links it as `roll` into `~/.local/bin`. This assumes you have this directory in your path.

```sh
cargo build --release && ln -s $PWD/target/release/feeling-dicey $HOME/.local/bin/roll
```

## Usage
Can be used either with arguments:

```sh
roll 4d6 1d4 # rolls four six-sided and one four-sided die
```

or via stdin:
```sh
echo '2d20 4d8' | roll
```

and can be used interactively by simply running it without arguments. This will wait for input and every newline will trigger rolling. End with `Ctrl+D`. Example:

```
 roll
4d6 2d4
Rolled    4d6:   17 ([2, 4, 6, 5])
Rolled    2d4:    8 ([4, 4])
             =   25
1d20
Rolled   1d20:    9 ([9])
             =    9
6d8 4d6
Rolled    6d8:   32 ([7, 3, 8, 7, 4, 3])
Rolled    4d6:   17 ([5, 5, 5, 2])
             =   49
```
